using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class BeginPanel : BasePanel<BeginPanel>
{
    public MyGUIButton btnBegin;
    public MyGUIButton btnSettings;
    public MyGUIButton btnQuit;
    public MyGUIButton btnRank;

    private void Start()
    {
        btnBegin.onClick += BtnBegin_onClick;
        btnSettings.onClick += BtnSettings_onClick;
        btnQuit.onClick += BtnQuit_onClick;
        btnRank.onClick += BtnRank_onClick;
        Cursor.lockState = CursorLockMode.Confined;
    }

    //切换场景
    private void BtnBegin_onClick()
    {
        SceneManager.LoadScene("GameScene");
    }
    //打开设置界面
    private void BtnSettings_onClick()
    {
        SettingPanel.Instance.ShowPanel();
        HidePanel();
    }
    //退出游戏
    private void BtnQuit_onClick()
    {
        Application.Quit();
    }
    //打开排行榜
    private void BtnRank_onClick()
    {
        RankPanel.Instance.ShowPanel();
        HidePanel();
    }

}
